package com.example.controller;


import com.example.domain.MFile;
import com.example.jsonfilter.SerializeField;
import com.example.listener.service.MyEventService;
import com.example.service.MFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;


@RestController
@RequestMapping("file")
public class MFileController {

    @Autowired
    private MFileService mFileService;




    @GetMapping("list")
    @SerializeField(clazz = MFile.class,includes = {"filename","id"})
    public Object getMFileController(){
        return mFileService.list();
    }


    @GetMapping("testsql")
    public Object sqlController(@RequestParam("str")String sql){
        return sql;
    }

    @PostMapping("testsql2")
    public Object sql2Controller(@RequestBody Map map){
        return map;
    }



}
